#pragma once

//=======================================================================================
// @bsiclass                                     Y.Dong                     %CreateTime%
//=======================================================================================
class %Class%Tool : public DgnPlatform::DgnPrimitiveTool, public PBBim::PBUIToWorkMessageEvent
{
    DEFINE_T_SUPER(DgnPlatform::DgnPrimitiveTool)
private:

    DgnProjectPtr m_project;
    IndexedViewportP m_viewport;
    PBModelInfoPtr m_modelInfoPtr;

    T_Point3dArray m_points;
    StatusInt CalculatePlacement(YawPitchRollAnglesR angles, DPoint3dCR startPt, DPoint3dR endPt);

protected:
    virtual Utf8CP _GetToolId() const override { return %schemaName%; }
    virtual void _OnPostInstall() override;
    virtual void _OnRestartTool() override;
    virtual bool _OnDataButton(DgnButtonEventCP ev) override;
    virtual bool _OnResetButton(DgnButtonEventCP ev) override;
    virtual void _OnDynamicFrame(DgnButtonEventCP ev) override;
    virtual void _OnReceive(Utf8CP messageType, JsonValueCR messageDataObj) override;
    virtual bool _OnModelMotion(DgnButtonEventCP ev) override;

public:
    %Class%Tool();
    ~%Class%Tool();
    void SetCurrentNote();
    void DynamicAtPoint(DPoint3d pt);
    StatusInt LineDynamic(DPoint3d ps, DPoint3d pe);
    bool CreateObject(DPoint3d origin);
};
